package com.imut.controller;

import com.imut.exception.BusinessException;
import org.springframework.web.bind.annotation.ModelAttribute;

import javax.servlet.http.HttpSession;

/**
 * @Author jiangYaPeng
 * @Date 2025-06-11 15:56
 */
public class BaseController {
    @ModelAttribute
    public void isLogin(HttpSession session) throws Exception {
        if (session.getAttribute("token") == null) {
            throw new BusinessException(401, "用户未登录");
        }
    }
}
